<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // concat()
        //   合并数组或元素，返回新的数组,原数组不会改变
        let arr1 = ['张飞', '关羽', '刘备'];
        let arr2 = ['猴子', '黑鸟'];
        let arr3 = ['剑圣','娜迦'];
        // 1. 参数是一个或多个数组
        // let result1 = arr1.concat(arr2);
        let result1 = arr1.concat(arr2,arr3);

        // 2. 原数组不受影响
        // console.log(arr1,arr2,result1);
        console.log(result1);

        // 3. 参数是元素
        let result2 = arr1.concat("吕布");
        console.log(result2);
      
    </script>
</body>

</html>